package com.zhx.sweet.handler;

import com.xiaoleilu.hutool.json.JSONUtil;
import org.springframework.security.core.Authentication;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author zhanghaixuan
 * @create 2018/4/18-上午11:09
 **/
public interface CuestomAuthentionSuccessHandler {
    default void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse httpServletResponse, Authentication authentication) throws IOException{
        httpServletResponse.setContentType("application/json,charset=UTF-8");
        httpServletResponse.getWriter().write(JSONUtil.toJsonStr(authentication));
    }
}
